package utils;

import android.content.Context;
import android.content.SharedPreferences;

import application.UIApplication;

/**
 * sharepreferences封装
 */
public class SharePreferHelper {
    /**
     *
     */
  private static SharedPreferences sp = UIApplication.getContext().getSharedPreferences("config", Context.MODE_PRIVATE);
    public static boolean getBooleanValues(String key, boolean defValue){

        return sp.getBoolean(key, defValue);
    }
    public static int getIntValues(String key, int defValue){

        return sp.getInt(key, defValue);
    }
    public static String getStrValues(String key, String defValue){


        return sp.getString(key, defValue);
    }
    public static void setBooleanValues(String key, boolean value){

        sp.edit().putBoolean(key, value).commit();
    }
    public static void setIntValues(String key, int value){

        sp.edit().putInt(key, value).commit();
    }
    public static void setStringValues(String key, String value){

        sp.edit().putString(key, value).commit();
    }
}
